package io.gitee.chearnee.fw.log.sql.model.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.ibatis.mapping.SqlCommandType;

import java.util.ArrayList;
import java.util.List;

/**
 * 暂时只封装这些字段，其他的关注度很少
 *
 * @author cn
 * @version 1.0
 * @description
 * @date 2023/7/18 18:43
 */
@Getter
@Setter
@ToString
public class SqlEntity {
    private String originalSql;
    /**
     * 表
     */
    private String table;
    /**
     * 列
     */
    private List<SqlColumn> columnList = new ArrayList<>();

    /**
     * sql类型
     */
    private SqlCommandType sqlCommandType;
    /**
     * where
     */
    private String where;

    public SqlEntity(SqlCommandType sqlCommandType, String originalSql) {
        this.sqlCommandType = sqlCommandType;
        this.originalSql = originalSql;
    }
}
